<template>
    <div>
        <button open-type="getUserInfo" class="agree" @getuserinfo="getUserInfo" lang="zh_CN">去设置</button>
        <p>{{isLogin}}</p>
        <!-- <p>{{userInfo.data.openId}}</p>
        <p>{{userInfo.data.nickname}}</p>
        <p>{{userInfo.data.openId}}</p> -->
    </div>

</template>
<script>
import store from '@/store'
export default {
  data() {
    return {
      motto: 'Hello World',
      canIUse: wx.canIUse('button.open-type.getUserInfo'),
      userDetail: {}
    }
  },
  computed: {
    // isLogin() {
    //   return store.state.app.isLogin
    // },
    userInfo() {
      return store.state.app.userInfo
    }
  },
  created() {},
  methods: {
    getUserInfo(e) {
      store.dispatch('WXGetUserInfo', e.mp.detail).then(res => {
        
      })
    }
  }
}
</script>

